/*
 * dbConnection.java
 *
 * Created on January 4, 2008, 11:17 AM
 *
 * To change this template, choose Tools | Template Manager
 * and open the template in the editor.
 */

package wispappautogeneration;
import java.sql.*;
import java.lang.Exception.*;

public class dbConnection {
    
    public Connection con;
    public dbConnection() {
    }
    
    public void connect()
    {		
        try 
        {
            Class.forName ("sun.jdbc.odbc.JdbcOdbcDriver");
            String url = "jdbc:odbc:wisp_db";

            con = DriverManager.getConnection(url, "", "");	 
            con.setAutoCommit(true);        				 
            System.out.println("CONNECTION SUCCESSFUL");
        }
        
        catch (Exception ex) 
        {
            System.out.println(ex.getMessage());	
        } 
    }		

    public void disconnect() 
    {
            try 
            {
                con.close();								
                System.out.println("DISCONNECTION SUCCESSFUL");
            } catch (Exception ex) 
            { 

                    System.out.println(ex.getMessage());	
            } 		
    }   
}
